package wearingparts

import (
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type ErotableRouter struct{}

// InitErotableRouter 初始化 易损件信息 路由信息
func (s *ErotableRouter) InitErotableRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
	ETRouter := Router.Group("ET").Use(middleware.OperationRecord())
	ETRouterWithoutRecord := Router.Group("ET")
	ETRouterWithoutAuth := PublicRouter.Group("ET")
	{
		ETRouter.POST("createErotable", ETApi.CreateErotable)             // 新建易损件信息
		ETRouter.DELETE("deleteErotable", ETApi.DeleteErotable)           // 删除易损件信息
		ETRouter.DELETE("deleteErotableByIds", ETApi.DeleteErotableByIds) // 批量删除易损件信息
		ETRouter.PUT("updateErotable", ETApi.UpdateErotable)              // 更新易损件信息
	}
	{
		ETRouterWithoutRecord.GET("findErotable", ETApi.FindErotable)       // 根据ID获取易损件信息
		ETRouterWithoutRecord.GET("getErotableList", ETApi.GetErotableList) // 获取易损件信息列表
	}
	{
		ETRouterWithoutAuth.GET("getErotablePublic", ETApi.GetErotablePublic) // 易损件信息开放接口
	}
}
